var http=require('http');

/*http.Server是events.Emitter的实例*/
var server = new http.Server();

server.on('request',function (req,res) {
     console.log(req.url);
     res.end('the message is recieved from '+ req.url)
}).listen(3000)

server.on('connection',function () {
   console.log('connected');
})

server.on('close',function () {
   console.log('the server is closing!')
})
